package com.adv.ems.db.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.adv.ems.db.entity.EnergyDataOriginalDO;

import java.util.List;

public interface EnergyDataOriginalMapper extends BaseMapper<EnergyDataOriginalDO> {

    default List<EnergyDataOriginalDO> loadUnDealData(Long lastId, Integer limit) {
        LambdaQueryWrapper<EnergyDataOriginalDO> wrapper = new LambdaQueryWrapper<>();
        wrapper.orderByAsc(EnergyDataOriginalDO::getId);
        wrapper.gt(EnergyDataOriginalDO::getId, lastId);
        wrapper.last(" limit " + limit);
        return selectList(wrapper);
    }
}
